UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EbZTHDgnGyW5WvHXIakYRzvchkhk7ihBUwME4eWo8U8=' 
WHERE 
  key_id = '483a78a65592f0e14bb58c9fb16ea52f3ec7ecba66fc67c818c3c4ec6c408544' 
  AND (
    token = 'EbZTHDgnGyW5WvHXIakYRzvchkhk7ihBUwME4eWo8U8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030