UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rrQJ+b/0xcvy0prhf6Th1PXzVtak7GLXE6zDfj/IQAE=' 
WHERE 
  key_id = 'fa4dc6e440c2506b4f4630f10a5e89f5b4e8cee2b449a81f673a03a25dd84987' 
  AND (
    token = 'rrQJ+b/0xcvy0prhf6Th1PXzVtak7GLXE6zDfj/IQAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050