UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EeOMsdUB+ZEi+n/Rgv2aFzb9MAIMIEwnEAoqOezd6Sw=' 
WHERE 
  key_id = '2e4378e3c0adbdf41e8fd87ada2bbf34323b151d47028cc00f23f92cff817ef7' 
  AND (
    token = 'EeOMsdUB+ZEi+n/Rgv2aFzb9MAIMIEwnEAoqOezd6Sw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031