UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nz75gY1G1bCbp5etSo144x2E/0pqK8rKyNm7PC9PyXY=' 
WHERE 
  key_id = '8f861793ff295d554f077309e18c38a4bed0bc6daea09bc1a70a2da01e9f2553' 
  AND (
    token = 'Nz75gY1G1bCbp5etSo144x2E/0pqK8rKyNm7PC9PyXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059