UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7070xcb6zJkHkYkbiqzi3TKzfk613DmZbuoglXvg+S4=' 
WHERE 
  key_id = 'ba78d2b247d85d9a3af2050cd58cf6fa59f72fda8e8ffbed23fd73d5c34d2ba2' 
  AND (
    token = '7070xcb6zJkHkYkbiqzi3TKzfk613DmZbuoglXvg+S4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028