UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0T/2mk111tfIuJsiRl/BMhyN3UuBsxeA6YXhu7fwbDk=' 
WHERE 
  key_id = 'd9d71e4ecd4519a7ecebf0185dc329ec4c47bea902711c31212d9c733fc11e6d' 
  AND (
    token = '0T/2mk111tfIuJsiRl/BMhyN3UuBsxeA6YXhu7fwbDk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029