UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SKY5QyiWT+ZkuIhvQtgsigiENCJM0zf4HTVYccVzMkc=' 
WHERE 
  key_id = '908c0887489006146ebba135ed7f562e477686dddf05272c6ab453c2f86156a3' 
  AND (
    token = 'SKY5QyiWT+ZkuIhvQtgsigiENCJM0zf4HTVYccVzMkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019