UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jxU7p1MLeTs0ak8PWYx2lFOdzhFoU3JFKDCL/v9OH/M=' 
WHERE 
  key_id = 'f3b153ccf168d4f615003b25ed3304bba2b6464b5b469c67606ed731f522e4cc' 
  AND (
    token = 'jxU7p1MLeTs0ak8PWYx2lFOdzhFoU3JFKDCL/v9OH/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075