UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mXyPs2MxkfGqR7hl6//w2wfPfKV8OfMbDk8xYh0XvDI=' 
WHERE 
  key_id = 'e76747bf714f42db3275824e42fa8f79709b90ce04a31e0a9e74e56f97656449' 
  AND (
    token = 'mXyPs2MxkfGqR7hl6//w2wfPfKV8OfMbDk8xYh0XvDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043