UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FmVGfq40IMreWpcOkCFLNvKdBckL8uo6PIHP9CzHFkA=' 
WHERE 
  key_id = '9b7d98919fa58a9bb01d4600a0427cd360d1c7169e7a497428a5d1334128f60d' 
  AND (
    token = 'FmVGfq40IMreWpcOkCFLNvKdBckL8uo6PIHP9CzHFkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026