UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'npU2e3uJLkhmctf2IKF4AEhR/JjxmVwi9U5nHG4ibUE=' 
WHERE 
  key_id = '5f61097015f70e3342a681950c7a9af7bfc807acb3643e7b896c6d5e8a115012' 
  AND (
    token = 'npU2e3uJLkhmctf2IKF4AEhR/JjxmVwi9U5nHG4ibUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021