UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jb9lEspSh/7auwfAtJQpvbp9pZy3hsBr2WXm5gZ9L+4=' 
WHERE 
  key_id = '82d5de5cd881ad1d41b1c2d0373e19ea5105ecc77047321cbe76036889404a96' 
  AND (
    token = 'jb9lEspSh/7auwfAtJQpvbp9pZy3hsBr2WXm5gZ9L+4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033