UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n1bq/5rj1Ox457YzFzgUUJrMbze2TWQYLyX/y5LnrjM=' 
WHERE 
  key_id = '63bc265cbabf3e0c76c8ff1cf88319ba2e72f08f6b431ec5999308de10812582' 
  AND (
    token = 'n1bq/5rj1Ox457YzFzgUUJrMbze2TWQYLyX/y5LnrjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034