UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wR+8JUmfRYk6jt96r3qhvPhdRz/LQ5AlIrJEIhn6kyI=' 
WHERE 
  key_id = '22b4c1e9568b103861da7d20165f31c6d5679abcfe2025a2d809290035e0918c' 
  AND (
    token = 'wR+8JUmfRYk6jt96r3qhvPhdRz/LQ5AlIrJEIhn6kyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035