UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQ0zisxqf5HwVwL0n85NM3MmFagNc0v5aUGdrh+AYcA=' 
WHERE 
  key_id = '7cef5204ca0b7618fc9b91e6777b8bc8f50bc208cded01a9c1c519431aa8c04d' 
  AND (
    token = 'eQ0zisxqf5HwVwL0n85NM3MmFagNc0v5aUGdrh+AYcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030