UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'poRBjyReqPO6ZBckynSrqZQiNECRFlz8maVPth2ofKk=' 
WHERE 
  key_id = '2c9bf6bf0e0d7e56216aee2b7604aa836674024c80ac5f1b5f83bf3f7af37230' 
  AND (
    token = 'poRBjyReqPO6ZBckynSrqZQiNECRFlz8maVPth2ofKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017