UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qeleqzno66pjWs3Wv1cBtxNdcQpii4p6/6YSGoxo5d4=' 
WHERE 
  key_id = 'a537f0b6e66a9c8be05a0f154233f805071f46e03151d40f2a1cea3ac569ec73' 
  AND (
    token = 'Qeleqzno66pjWs3Wv1cBtxNdcQpii4p6/6YSGoxo5d4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049