UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pXwOXGFGlsEGpsaGVZ0OY4NduwJpNJ+4jzAImgoVAlA=' 
WHERE 
  key_id = '32aa91d83958c69b4279258b10f3cc5fbaaef0b4c64c646aac985f3fabe6214d' 
  AND (
    token = 'pXwOXGFGlsEGpsaGVZ0OY4NduwJpNJ+4jzAImgoVAlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00101