UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B2HYzPJg69IyndGsKRnJIVSJkvP4ALw/j6zTm5SADp4=' 
WHERE 
  key_id = 'ccbd248407df6f9f404423640b69b5d7c5317219d4c7e74e33bb812974e86563' 
  AND (
    token = 'B2HYzPJg69IyndGsKRnJIVSJkvP4ALw/j6zTm5SADp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043