UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3q7uIFRN0nMW5fh/Xqwi4mP7xooOFRhnPqknI0U6tY=' 
WHERE 
  key_id = '3b529c00768fb2396076f8a073d5d22580615ea55c49bd488fd4eb5c3e94d259' 
  AND (
    token = 'Y3q7uIFRN0nMW5fh/Xqwi4mP7xooOFRhnPqknI0U6tY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032