UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7xvInEQLmp3tgp9ynPAEnMDH6atuz8ZAPQ1oxDcnvs=' 
WHERE 
  key_id = 'c0a55e0a74c9aeeff83ed9212c1dcc191dc05f0b95a0b5f7db709f17e7449168' 
  AND (
    token = '+7xvInEQLmp3tgp9ynPAEnMDH6atuz8ZAPQ1oxDcnvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019