UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZB8uMGno/sAILhJ4V2T/H6NYB9+bXjfaH7GfGH/THFA=' 
WHERE 
  key_id = '02297b524d92940762ad5812a1c58cfac13bf3a99b1c7875009d243b4262a074' 
  AND (
    token = 'ZB8uMGno/sAILhJ4V2T/H6NYB9+bXjfaH7GfGH/THFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029