UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hxn06lKfGZ/K5q7AxNhsYHRUpqfd762zYTPLSlrZRTk=' 
WHERE 
  key_id = 'db7010e90ace53f16f4107ad45e3780d176c71c4e0c40dccb2a81589d91ab047' 
  AND (
    token = 'Hxn06lKfGZ/K5q7AxNhsYHRUpqfd762zYTPLSlrZRTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029